module WindSpirit
{
    export class MarskLayer extends egret.DisplayObjectContainer
    {
        public marsk: egret.Shape;
        public container: egret.DisplayObjectContainer;
        public constructor()
        {
            super();
            this.width = WindSpirit.Util.stageW;
            this.height = WindSpirit.Util.stageH;
            var marsk = new egret.Shape;
            marsk.graphics.beginFill(0,0.8);
            marsk.graphics.drawRect(0,0,this.width,this.height);
            marsk.touchEnabled = true;
            this.addChild(marsk);
            this.marsk = marsk;
            var container = new egret.DisplayObjectContainer;
            container.width = WindSpirit.Const.DESIGN_WIDTH;
            container.height = WindSpirit.Const.DESIGN_HEIGHT;
            this.container = container;
            this.addChild(container);
            if(this.width > container.width)
            {
                container.x = (this.width - container.width) >> 1;
            }
            if(this.height > container.height)
            {
                container.y = (this.height - container.height) >> 1;
            }
        }
    }
}